<?php
$ch=curl_init();//实劣化
$url="https://www.17k.com/all";
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);

$data=curl_exec($ch);
$res='#<tr class="bg0">.*<td class="td2">.*<a href=".*" target=".*">(.*)</a>.*</td>.*<td class="td5">(.*)</td>.*</tr>#isU';

preg_match_all($res,$data,$rud);

$h_name=$rud[1];
$h_num=$rud[2];


$sql="insert into hoog (h_name,h_num) VALUES";

foreach($h_name as $k=>$v)
{
    $sql.="('$h_name[$k]','$h_num[$k]'),";
}
$dbh = new PDO('mysql:host=127.0.0.1;dbname=pookd', 'root', 'root');
$sql=substr($sql,0,-1);
echo $sql;die;
echo $dbh->exec($sql);
var_dump($data);
?>